﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SaleOnlineSystem
{
    public partial class ListNews : System.Web.UI.Page
    {

        public static int sizePage;
        public static int currentPage;

      
        public static DataTable dt;
        public static int AllCat;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                sizePage = 9;

                if (Request.QueryString["currentPage"] != null)
                {
                   



                    currentPage = Convert.ToInt32(Request.QueryString["currentPage"].ToString());
                    dt = BOL.ProductManager.Instance.GetListNewsPaging("tbl_News", "pagingnews", currentPage, sizePage,
                                                                       "News_Date", "DESC");
                }


                else
                {
                    currentPage = 1;

                    dt = BOL.ProductManager.Instance.GetListNewsPaging("tbl_News", "pagingnews", currentPage, sizePage,
                                                                    "News_Date", "DESC");
                   
                }


                // VIet stored dem so san pham co catID = CatID


                AllCat = DAL.DCollector.DBCollector.Instance.StoredProcedureSelectCountRows("tbl_News");

                
            }

        }
    }
}